<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>社交网站导航组件集合</title>
  <!-- Bootstrap 5 CSS -->
  <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
  <!-- Font Awesome -->
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/font-awesome@4.7.0/css/font-awesome.min.css">
  
  <style>
    :root {
      --primary: #165DFF;
      --primary-light: #E8F3FF;
      --secondary: #6B7280;
      --light: #F9FAFB;
      --dark: #1F2937;
      --danger: #EF4444;
      --success: #10B981;
      --warning: #F59E0B;
    }
    
    body {
      font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
      padding-top: 20px;
    }
    
    .section-title {
      margin: 40px 0 20px;
      padding-bottom: 10px;
      border-bottom: 2px solid var(--primary-light);
      color: var(--dark);
    }
    
    .nav-example {
      margin-bottom: 30px;
      border: 1px solid #e5e7eb;
      border-radius: 8px;
      overflow: hidden;
    }
    
    .nav-header {
      background-color: var(--light);
      padding: 12px 15px;
      font-weight: 600;
      border-bottom: 1px solid #e5e7eb;
      font-size: 14px;
      color: var(--secondary);
    }
    
    /* 顶部导航栏样式 */
    .top-nav {
      background-color: white;
      box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    }
    
    .logo {
      color: var(--primary);
      font-weight: 700;
      font-size: 1.25rem;
      display: flex;
      align-items: center;
    }
    
    .logo i {
      margin-right: 8px;
    }
    
    .search-box {
      position: relative;
      max-width: 360px;
      width: 100%;
    }
    
    .search-box input {
      padding-left: 36px;
      background-color: var(--light);
      border-color: #e5e7eb;
      border-radius: 6px;
    }
    
    .search-box i {
      position: absolute;
      left: 12px;
      top: 50%;
      transform: translateY(-50%);
      color: var(--secondary);
    }
    
    .nav-actions .nav-link {
      color: var(--secondary);
      padding: 8px 12px;
      position: relative;
    }
    
    .nav-actions .nav-link:hover {
      color: var(--primary);
    }
    
    .nav-actions .notification-badge {
      position: absolute;
      top: 5px;
      right: 5px;
      width: 8px;
      height: 8px;
      background-color: var(--danger);
      border-radius: 50%;
    }
    
    /* 侧边导航样式 */
    .sidebar-container {
      display: flex;
      min-height: 400px;
    }
    
    .sidebar {
      width: 240px;
      background-color: white;
      border-right: 1px solid #e5e7eb;
    }
    
    .sidebar-nav {
      padding: 0;
      margin: 0;
      list-style: none;
    }
    
    .sidebar-nav .nav-item {
      margin-bottom: 2px;
    }
    
    .sidebar-nav .nav-link {
      display: flex;
      align-items: center;
      padding: 12px 15px;
      color: var(--secondary);
      text-decoration: none;
      transition: all 0.2s;
    }
    
    .sidebar-nav .nav-link:hover {
      background-color: var(--primary-light);
      color: var(--primary);
    }
    
    .sidebar-nav .nav-link.active {
      background-color: var(--primary-light);
      color: var(--primary);
      font-weight: 500;
      border-left: 3px solid var(--primary);
    }
    
    .sidebar-nav .nav-link i {
      width: 20px;
      margin-right: 10px;
      text-align: center;
    }
    
    .sidebar-nav .nav-divider {
      height: 1px;
      background-color: #e5e7eb;
      margin: 10px 0;
    }
    
    .sidebar-content {
      flex: 1;
      padding: 15px;
      background-color: #f9fafb;
    }
    
    /* 底部导航样式 */
    .bottom-nav-container {
      max-width: 360px;
      margin: 0 auto;
      position: relative;
    }
    
    .bottom-nav {
      display: flex;
      justify-content: space-around;
      background-color: white;
      padding: 10px 0;
      box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
    }
    
    .bottom-nav-item {
      display: flex;
      flex-direction: column;
      align-items: center;
      color: var(--secondary);
      text-decoration: none;
      font-size: 12px;
      flex: 1;
    }
    
    .bottom-nav-item i {
      font-size: 20px;
      margin-bottom: 4px;
    }
    
    .bottom-nav-item.active {
      color: var(--primary);
    }
    
    .bottom-nav-item.primary-action {
      position: relative;
      top: -15px;
    }
    
    .bottom-nav-item.primary-action i {
      width: 50px;
      height: 50px;
      background-color: var(--primary);
      color: white;
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
      box-shadow: 0 4px 12px rgba(22, 93, 255, 0.3);
    }
    
    /* 分类导航样式 */
    .category-nav {
      background-color: white;
      padding: 10px 0;
      border-bottom: 1px solid #e5e7eb;
      overflow-x: auto;
    }
    
    .category-nav-inner {
      display: flex;
      padding: 5px 15px;
    }
    
    .category-item {
      display: flex;
      flex-direction: column;
      align-items: center;
      margin-right: 20px;
      color: var(--secondary);
      text-decoration: none;
      font-size: 12px;
      white-space: nowrap;
    }
    
    .category-item i {
      font-size: 20px;
      margin-bottom: 5px;
      width: 40px;
      height: 40px;
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
      background-color: var(--light);
    }
    
    .category-item.active {
      color: var(--primary);
    }
    
    .category-item.active i {
      background-color: var(--primary-light);
      color: var(--primary);
    }
    
    /* 下拉导航样式 */
    .dropdown-nav {
      background-color: white;
      padding: 10px 15px;
      border-bottom: 1px solid #e5e7eb;
    }
    
    .dropdown-menu {
      min-width: 180px;
    }
    
    .dropdown-item {
      display: flex;
      align-items: center;
    }
    
    .dropdown-item i {
      width: 20px;
      margin-right: 10px;
      text-align: center;
      color: var(--secondary);
    }
    
    /* 顶部标签导航 */
    .tabs-nav {
      background-color: white;
      border-bottom: 1px solid #e5e7eb;
    }
    
    .tab-item {
      display: inline-block;
      padding: 12px 20px;
      color: var(--secondary);
      text-decoration: none;
      font-weight: 500;
      border-bottom: 2px solid transparent;
    }
    
    .tab-item:hover {
      color: var(--primary);
    }
    
    .tab-item.active {
      color: var(--primary);
      border-bottom-color: var(--primary);
    }
    
    /* 响应式调整 */
    @media (max-width: 768px) {
      .search-box {
        max-width: none;
        margin: 10px 0;
      }
      
      .sidebar {
        width: 70px;
      }
      
      .sidebar-nav .nav-link span {
        display: none;
      }
      
      .sidebar-nav .nav-link i {
        margin-right: 0;
        font-size: 18px;
      }
    }
  </style>
</head>
<body>
  <div class="container">
    <h1 class="mb-5 text-center">社交网站导航组件集合</h1>
    
    <!-- 1. 顶部主导航 -->
    <h2 class="section-title">1. 顶部主导航</h2>
    <div class="nav-example">
      <div class="nav-header">适用于桌面端的顶部主导航栏，包含logo、搜索框和用户功能</div>
      <nav class="navbar navbar-expand-lg top-nav">
        <div class="container">
          <a class="logo" href="#">
            <i class="fa fa-connectdevelop"></i>社交圈
          </a>
          <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#mainNav">
            <span class="navbar-toggler-icon"></span>
          </button>
          
          <div class="collapse navbar-collapse" id="mainNav">
            <div class="search-box mx-auto">
              <i class="fa fa-search"></i>
              <input type="text" class="form-control" placeholder="搜索内容、用户或标签...">
            </div>
            
            <ul class="navbar-nav nav-actions">
              <li class="nav-item">
                <a class="nav-link" href="#">
                  <i class="fa fa-home fa-lg"></i>
                </a>
              </li>
              <li class="nav-item">
                <a class="nav-link" href="#">
                  <i class="fa fa-compass fa-lg"></i>
                </a>
              </li>
              <li class="nav-item">
                <a class="nav-link" href="#">
                  <i class="fa fa-bell-o fa-lg"></i>
                  <span class="notification-badge"></span>
                </a>
              </li>
              <li class="nav-item dropdown">
                <a class="nav-link dropdown-toggle" href="#" data-bs-toggle="dropdown">
                  <img src="https://picsum.photos/32/32?random=1" alt="用户头像" class="rounded-circle" width="32" height="32">
                </a>
                <ul class="dropdown-menu dropdown-menu-end">
                  <li><a class="dropdown-item" href="#">个人主页</a></li>
                  <li><a class="dropdown-item" href="#">设置</a></li>
                  <li><hr class="dropdown-divider"></li>
                  <li><a class="dropdown-item" href="#">退出登录</a></li>
                </ul>
              </li>
            </ul>
          </div>
        </div>
      </nav>
    </div>
    
    <!-- 2. 侧边导航 -->
    <h2 class="section-title">2. 侧边导航</h2>
    <div class="nav-example">
      <div class="nav-header">适用于管理后台或内容分类较多的页面</div>
      <div class="sidebar-container">
        <div class="sidebar">
          <ul class="sidebar-nav">
            <li class="nav-item">
              <a href="#" class="nav-link active">
                <i class="fa fa-tachometer"></i>
                <span>首页</span>
              </a>
            </li>
            <li class="nav-item">
              <a href="#" class="nav-link">
                <i class="fa fa-user-o"></i>
                <span>个人资料</span>
              </a>
            </li>
            <li class="nav-item">
              <a href="#" class="nav-link">
                <i class="fa fa-comments-o"></i>
                <span>消息中心</span>
              </a>
            </li>
            <li class="nav-item">
              <a href="#" class="nav-link">
                <i class="fa fa-bookmark-o"></i>
                <span>收藏内容</span>
              </a>
            </li>
            <li class="nav-divider"></li>
            <li class="nav-item">
              <a href="#" class="nav-link">
                <i class="fa fa-line-chart"></i>
                <span>数据分析</span>
              </a>
            </li>
            <li class="nav-item">
              <a href="#" class="nav-link">
                <i class="fa fa-cog"></i>
                <span>账号设置</span>
              </a>
            </li>
          </ul>
        </div>
        <div class="sidebar-content">
          <p>主内容区域...</p>
          <p>侧边导航适合展示较多的功能分类</p>
        </div>
      </div>
    </div>
    
    <!-- 3. 底部导航 -->
    <h2 class="section-title">3. 底部导航</h2>
    <div class="nav-example">
      <div class="nav-header">适用于移动端的底部导航，操作便捷</div>
      <div class="bottom-nav-container">
        <nav class="bottom-nav">
          <a href="#" class="bottom-nav-item active">
            <i class="fa fa-home"></i>
            <span>首页</span>
          </a>
          <a href="#" class="bottom-nav-item">
            <i class="fa fa-compass"></i>
            <span>发现</span>
          </a>
          <a href="#" class="bottom-nav-item primary-action">
            <i class="fa fa-plus"></i>
          </a>
          <a href="#" class="bottom-nav-item">
            <i class="fa fa-bell-o"></i>
            <span>通知</span>
          </a>
          <a href="#" class="bottom-nav-item">
            <i class="fa fa-user-o"></i>
            <span>我的</span>
          </a>
        </nav>
      </div>
    </div>
    
    <!-- 4. 分类导航 -->
    <h2 class="section-title">4. 分类导航</h2>
    <div class="nav-example">
      <div class="nav-header">适用于展示多种内容分类的图标导航</div>
      <div class="category-nav">
        <div class="category-nav-inner">
          <a href="#" class="category-item active">
            <i class="fa fa-th-large"></i>
            <span>全部</span>
          </a>
          <a href="#" class="category-item">
            <i class="fa fa-picture-o"></i>
            <span>图片</span>
          </a>
          <a href="#" class="category-item">
            <i class="fa fa-video-camera"></i>
            <span>视频</span>
          </a>
          <a href="#" class="category-item">
            <i class="fa fa-file-text-o"></i>
            <span>文章</span>
          </a>
          <a href="#" class="category-item">
            <i class="fa fa-shopping-bag"></i>
            <span>商品</span>
          </a>
          <a href="#" class="category-item">
            <i class="fa fa-music"></i>
            <span>音乐</span>
          </a>
          <a href="#" class="category-item">
            <i class="fa fa-gamepad"></i>
            <span>游戏</span>
          </a>
          <a href="#" class="category-item">
            <i class="fa fa-cutlery"></i>
            <span>美食</span>
          </a>
          <a href="#" class="category-item">
            <i class="fa fa-plane"></i>
            <span>旅行</span>
          </a>
        </div>
      </div>
    </div>
    
    <!-- 5. 下拉导航 -->
    <h2 class="section-title">5. 下拉导航</h2>
    <div class="nav-example">
      <div class="nav-header">适用于功能选项较多的下拉菜单导航</div>
      <div class="dropdown-nav">
        <div class="container d-flex align-items-center justify-content-between">
          <div class="d-flex gap-3">
            <div class="dropdown">
              <button class="btn btn-outline-light dropdown-toggle" type="button" data-bs-toggle="dropdown">
                内容分类
              </button>
              <ul class="dropdown-menu">
                <li><a class="dropdown-item" href="#"><i class="fa fa-file-text-o"></i>文章</a></li>
                <li><a class="dropdown-item" href="#"><i class="fa fa-picture-o"></i>相册</a></li>
                <li><a class="dropdown-item" href="#"><i class="fa fa-video-camera"></i>视频</a></li>
                <li><a class="dropdown-item" href="#"><i class="fa fa-comments-o"></i>动态</a></li>
              </ul>
            </div>
            
            <div class="dropdown">
              <button class="btn btn-outline-light dropdown-toggle" type="button" data-bs-toggle="dropdown">
                排序方式
              </button>
              <ul class="dropdown-menu">
                <li><a class="dropdown-item" href="#"><i class="fa fa-clock-o"></i>最新发布</a></li>
                <li><a class="dropdown-item" href="#"><i class="fa fa-fire"></i>热门推荐</a></li>
                <li><a class="dropdown-item" href="#"><i class="fa fa-eye"></i>最多浏览</a></li>
                <li><a class="dropdown-item" href="#"><i class="fa fa-heart-o"></i>最多点赞</a></li>
              </ul>
            </div>
          </div>
          
          <div class="dropdown">
            <button class="btn btn-outline-light dropdown-toggle" type="button" data-bs-toggle="dropdown">
              <i class="fa fa-filter"></i> 筛选
            </button>
            <ul class="dropdown-menu dropdown-menu-end">
              <li><a class="dropdown-item" href="#">今天</a></li>
              <li><a class="dropdown-item" href="#">本周</a></li>
              <li><a class="dropdown-item" href="#">本月</a></li>
              <li><hr class="dropdown-divider"></li>
              <li><a class="dropdown-item" href="#">关注的人</a></li>
            </ul>
          </div>
        </div>
      </div>
    </div>
    
    <!-- 6. 顶部标签导航 -->
    <h2 class="section-title">6. 顶部标签导航</h2>
    <div class="nav-example">
      <div class="nav-header">适用于同一模块下的内容标签切换</div>
      <div class="tabs-nav">
        <div class="container">
          <a href="#" class="tab-item active">全部</a>
          <a href="#" class="tab-item">关注</a>
          <a href="#" class="tab-item">推荐</a>
          <a href="#" class="tab-item">热门</a>
          <a href="#" class="tab-item">最新</a>
          <a href="#" class="tab-item">附近</a>
        </div>
      </div>
    </div>
  </div>
  
  <!-- Bootstrap JS -->
  <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
  
  <script>
    // 导航交互效果
    document.querySelectorAll('.tab-item, .category-item, .bottom-nav-item, .sidebar-nav .nav-link').forEach(item => {
      item.addEventListener('click', function(e) {
        e.preventDefault();
        
        // 移除同组中其他项的active类
        const parent = this.parentElement;
        parent.querySelectorAll('.active').forEach(el => {
          el.classList.remove('active');
        });
        
        // 给当前项添加active类
        this.classList.add('active');
      });
    });
  </script>
</body>
</html>
